Skip to content

Conversation

@lgritz
Copy link
Collaborator

@lgritz lgritz commented Jan 18, 2026

Utilities to ask the IB for the local pixels as an untyped span of bytes. This is a "safe" alternative to localpixels(), which just returned a single pointer, instead returning an image_span that understands the sizes and strides of the buffer.

Utilities to ask the IB for the local pixels as an untyped span
of bytes. This is a "safe" alternative to `localpixels()`, which
just returned a single pointer, instead returning an image_span
that understands the sizes and strides of the buffer.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz
Copy link
Collaborator Author

lgritz commented Jan 19, 2026

Note: the bleeding edge test failure is not from this PR, it's due to a new commit in main of pybind11 that is causing things to crash. I have reported it.

@lgritz
Copy link
Collaborator Author

lgritz commented Jan 23, 2026

Any comments?

Comment on lines +1372 to +1374
/// Return an `image_span<const std::byte>` giving the extent and layout
/// of "local" pixel memory, if they are fully in RAM and not backed by an
/// ImageCache, or an empty span otherwise.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[consider] It may be clearer to indicate that the return of this can be inferred from ImageBuf::storage. So for example:

Return an .. if ImageBuf::storage() is Storage::MEMORY`, otherwise ...

Apokogies if I botched that ayntax but hopefully the intention comes across

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm going to keep it as-is, because the storage test is actually a little more complicated than that. There are multiple storage() types that have addressable pixels, and multiple (at some point in the future, if not now) that do not. So I think keeping vague "if they are fully in RAM" is the distinction I'm trying to make.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants